<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 同步回调
    // [1, 2, 3].forEach(item => {
    //   console.log(item)
    // })
    // console.log('forEach()之后')

    new Promise((resolve, reject) => { // excutor  执行器函数    
      console.log('执行excutor')
      // 执行异步任务


    }).then((response) => {}, (error) => {})
    console.log('new Promise()之后')

    // // 异步回调
    setTimeout(() => {
      console.log('执行timout回调')
    }, 0)
    console.log('setTimeout()之后')

    Promise.resolve(1).then(() => {
      console.log('promise成功的回调')
    })
    console.log('.then之后')
  </script>
</body>
</html>